#include<iostream>
#include<cstdio>
#include<malloc.h>
using namespace std;

char *strcat(char *str1,char *str2)
{
	int i=0,j=0,count=0;
	while(str1[i]!='\0')
	{
		i++;
		count++;
	}
	i=0;
	while(str2[i]!='\0')
	{
		i++;
		count++;
	}
	count++;
	char *strsum;
	strsum=(char*)malloc(sizeof(char)*count);
	i=0;
	while(str1[i]!='\0')
	{
		strsum[i]=str1[i];
		i++;
	}
	while(str2[j]!='\0')
	{
		strsum[i]=str2[j];
		i++;
		j++;
	}
	strsum[i]='\0';
	return strsum;
}
int main()
{
	char *str1="hello",*str2="world",*str3;
	str3=strcat(str1,str2);
	cout<<str3;
	return 0;
 } 

